package com.indusfo.spc.pojo;

import com.indusfo.spc.common.pojo.BasePojo;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author chenm
 * @create 2019-07-23 14:04
 */
@Getter
@Setter
@Entity
@Table(name="T_B75_RULE_LIST")
public class RuleList extends BasePojo {

    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "RULE_DETAIL_ID", insertable = false)
    private Integer ruleDetailId;//id

    private Integer ruleId;//规则的id
    private String ruleName;//规则的名称

    private String autoid;//序号

    private Integer cl;//常量
    private String clName;//常量名称
    private String first;//初始值

    private Integer typeId;//类型ID
    private String type;//类型

    private Integer formId;//格式ID

    private String form;//格式

    private String len;//长度

    private String length;//步长

    private String remark;//备注

    //1启用，2，停用，3删除
    private Integer dataState = 1;//状态
    private String dataStateName ;// 状态名称

    public String getDataStateName() {
        Integer dataState = getDataState();
        String lDataStateName ="";
        switch (dataState){
            case 1:
                lDataStateName = "启用";
                break;
            case 2:
                lDataStateName = "删除";
                break;
            case 3:
                lDataStateName = "停用";
                break;
        }
        return lDataStateName;
    }

    public RuleList() {
    }

    public RuleList(String ruleName,String clName, String first, String type, String form, String len,String length, String remark) {
        this.ruleName=ruleName;
        this.clName = clName;
        this.first = first;
        this.type = type;
        this.form = form;
        this.len = len;
        this.length=length;
        this.remark = remark;
    }
}


